/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package server;


import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;


/**
 *
 * @author Sandro
 */
public class MenuServer implements ActionListener {

        private JFrame jf;
        private JLabel ip;
        private JLabel gameName;
        private JLabel gameStatus;
        private JTextField newGame;
        private JButton startGame;
        private JButton stopGame;
        private JButton stopServer;

       
    public MenuServer(){
        super();
        jf=new JFrame("Server Vidas");
        jf.setBounds(100,100,420,200);
       
        jf.getContentPane().setLayout(null);

        newGame = new JTextField();
        newGame.setBounds(50,10,100,20);
        jf.getContentPane().add(newGame);

        ip = new JLabel();
        ip.setBounds(50,40,100,20);
        jf.getContentPane().add(ip);
        ip.setText("IP:");

        gameName = new JLabel();
        gameName.setBounds(50,70,100,20);
        jf.getContentPane().add(gameName);
        gameName.setText("Juego: No Hay Juego");

        gameStatus = new JLabel();
        gameStatus.setBounds(50,100,100,20);
        jf.getContentPane().add(gameStatus);
        gameStatus.setText("Estado: No Informado");

        startGame=new JButton("Iniciar");
        startGame.setBounds(50,130,100,20);
        jf.getContentPane().add(startGame);
        startGame.addActionListener(this);

        stopGame=new JButton("Parar");
        stopGame.setBounds(160,130,100,20);
        jf.getContentPane().add(stopGame);
        stopGame.addActionListener(this);

        stopServer=new JButton("Salir");
        stopServer.setBounds(270,130,100,20);
        jf.getContentPane().add(stopServer);
        stopServer.addActionListener(this);

        jf.setVisible(true);
    }

    
    @Override
    public void actionPerformed(ActionEvent e) {
        //Hacer nada
    }

      public void setIp(String ip) {
        this.ip.setText("IP: "+ip);
      }

      public void setSatus(String s){
        this.gameStatus.setText("Estado: "+s);
      }

      public void setGameName(String name) {
        this.ip.setText("Juego: "+name);
      }

      public void setStartGameListener(ActionListener stopper){
        startGame.addActionListener(stopper);
      }
      public void setStopGameListener(ActionListener stopper){
        stopGame.addActionListener(stopper);
      }

      public void setStopServerListener(ActionListener stopper){
        stopServer.addActionListener(stopper);
      }

      
}
